<!--This file is the User Interface only for Registration-->

<?php
session_start();

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-Transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <title>Rotaract DLSU</title>
        <meta http-equiv="Content-Type" content="text/html"/>
        <meta name="robots" content="index,follow"/>
        <meta name="distribution" content="global"/>
        <meta name="description" content=""/>
        <meta name="keywords" content=""/>
        <link href="css/style.css" rel="stylesheet" type="text/css" media="screen" />
        <script type="text/javascript" src="javascript/RegistrationValidation.js"></script>
    </head>
    <body>
        <!--        This part is the user interface-->
        <div id="container2">
            <div id="main2">
                <table width="100%" cellspacing="0" cellpadding="0">
                    <tr>
                        <td class="main_nav">
                            <div id="main_text2">
                                <form id="register" action="RAC-RegistrationUI.php" method="POST">
                                    <center><div class="login">
                                    <table cellpadding="2" cellspacing="0" border="0">
                                        <p style="color: white;">*Username should be at least 6 characters with no special characters.<br/>
                                        *Password should be at least 8 characters. <br/>
                                        *All fields are required. </p><br />
                                        <img src="images/registration.png" height="80" width="80  " /><h2 style="color: white;">Officer Registration</h2><br>
                                            
                                        <tr><td width="130" style="color: white;">First Name:</td><td width="140"><input name="firstname" type="text" size="15" /><label id="errorfirstname" style="color: red;"></label></td></tr>
                                        <tr><td width="130" style="color: white;">Last Name:</td><td width="140"><input name="lastname" type="text" size="15" /><label id="errorlastname" style="color: red;"></label></td></tr>
                                        <tr><td width="130" style="color: white;">Username:</td><td width="140"><input name="username" type="text" size="15" /><label id="errorusername" style="color: red;"></label></td></tr>
                                        <tr><td style="color: white;">Password:</td><td><input name="password" type="password" size="15" /><label id="errorpassword" style="color: red;"></label></td></tr>
                                        <tr><td style="color: white;">Confirm Password:</td><td><input name="password2" type="password" size="15" /><label id="errorpassword2" style="color: red;"></label></td></tr>
                                        <tr><td width="130" style="color: white;">Position:</td><td width="140">
                                                <select name="position">
                                                    <option value="President">President</option>
                                                    <option value="EVP Internals">EVP Internals</option>
                                                    <option value="EVP Externals">EVP Externals</option>
                                                    <option value="VP Documentations">VP Documentations</option>
                                                    <option value="AVP Internal Documentations">AVP Internal Documentations</option>
                                                    <option value="AVP District Documentations">AVP District Documentations</option>
                                                    <option value="VP Finance">VP Finance</option>
                                                    <option value="AVP Finance">AVP Finance</option>
                                                    <option value="VP Club Service">VP Club Service</option>
                                                    
                                                    <option value="AVP Internal Relations">AVP Internal Relations</option>
                                                    <option value="AVP Productions">AVP Productions</option>
                                                    
                                                    <option value="AVP Publicity"> AVP Publicity</option>
                                                    <option value="VP Community Service">VP Community Service</option>
                                                    <option value="AVP Social Relation">AVP Social Relation</option>
                                                    <option value="AVP Operations"> AVP Operations</option>
                                                    <option value="VP Professional Service">VP Professional Service</option>
                                                    
                                                    <option value="AVP Leadership Proficiency">AVP Leadership Proficiency</option>
                                                    <option value="AVP Personal Enrichment">AVP Personal Enrichment</option>
                                                    <option value="VP International Service">VP International Service</option>
                                                    <option value="AVP District Relations"> AVP District Relations</option>
                                                    <option value="AVP Club Relations"> AVP Club Relations</option>
                                                    <option value="AVP Promotions and Sponsorshi"> AVP Promotions and Sponsorship</option>
                                                </select>
                                                <label id="errorposition"></label></td></tr>
                                        <tr><td style="color: white;">E-mail:</td><td><input name="email" type="TEXT" size="15" /><label id="erroremail" style="color: red;"></label></td></tr>
                                        <tr><td colspan="2" style="color: white;"><input type="submit" name="submit" value="Register" onClick="return validateAll(this.form);" /></td></tr>
                                    
                                        </table></div>
                                </form>   
                                
<!--                            Printing the confirmation message.
                                $confirm variable comes from the Logic file which is the RAC-Registration.php-->
                                <?php
                                
                                $confirm = '';
                                if (isset($_POST['submit'])){
                                include 'RAC-Registration.php';
                                
                                if($confirm){
                                    echo "<h4>Registration Successful!</h4>";
                                }
                                else
                                    echo "<h4>Username already exists!</h4>";
                                }
                                ?>

                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </body>
</html>
